// 保存 token 到本地存储
export const setToken = (token: string): void => {
  localStorage.setItem('token', token)
}

// 从本地存储获取 token
export const getToken = (): string | null => {
  return localStorage.getItem('token')
}

// 移除 token
export const removeToken = (): void => {
  localStorage.removeItem('token')
}

// 检查是否已登录
export const isAuthenticated = (): boolean => {
  return getToken() !== null
}